<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>异步更新dom</title>
</head>
<body>
<ul id="test"></ul>
<script>
    var target = document.getElementById('test');
    const iter = 6;
    let i = 0;
    const liCount = 10000;
    setTimeout(function updateDom() {
        for (var j = 0; j < liCount; j++) {
            var li = document.createElement('li');
            li.append(document.createTextNode(i * liCount + j))
            target.append(li)
        }
        i++;
        if (i < iter) {
            setTimeout(updateDom, 0)
        }
    }, 0)
</script>
</body>
</html>
